package com.ttc.ssm.service.admin.impl;

import com.ttc.ssm.mapper.admin.UserMapper;
import com.ttc.ssm.po.User;
import com.ttc.ssm.service.admin.UserService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Jiarui on 2016/7/21.
 */
public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;

    @Override
    public User getUserByUsername(String name) throws Exception {
        User user = userMapper.getUserByUsername(name);
        return user;
    }

    @Override
    public void change_psw(int user_id, String new_psw) throws Exception {
        userMapper.change_psw(user_id,new_psw);
    }

    @Override
    public User getUserById(int user_id) throws Exception {
        return userMapper.getUserById(user_id);
    }
}
